Skip to content

Cortex-M: make quantized add and multiply layout-agnostic - #21966

Draft
rascani wants to merge 9 commits into
gh/rascani/20/headfrom
gh/rascani/12/head
Draft

Cortex-M: make quantized add and multiply layout-agnostic#21966
rascani wants to merge 9 commits into
gh/rascani/20/headfrom
gh/rascani/12/head

Conversation

@rascani

@rascani rascani commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Derive the channel-broadcast repeat length from the broadcast operand's element
count instead of a hard-coded channel dimension, so one pair of operators serves
both the legacy NCHW-logical channels-last contract and the NHWC-logical
contiguous one.

The kernels already read identical bytes under either contract; only the shape
metadata placed channels at a different index. Consult the dim order of the
larger operand rather than sniffing the shape, which stays correct when the
broadcast operand's unit dimensions leave its own dim order ambiguous. The
quantizer keeps asking the logical NCHW question it asked before, since it runs
ahead of any layout transform.

Cortex-M55 FVP add and multiply suites, the explicit-NHWC runtime cases, host
layout-parity coverage comparing both contracts through one operator, and
lintrunner.

Authored with Codex.

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21966

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 Cancelled Job, 5 Unrelated Failures

As of commit 33d1db0 with merge base 8b93850 (image):

CANCELLED JOB - The following job was cancelled. Please retry:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@rascani rascani changed the title Cortex-M: add explicit-NHWC channel-broadcast ops Cortex-M: make quantized add and multiply layout-agnostic Aug 21, 2026
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant